<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div style="margin-top: 100px; width: 100%; height: 200px; float: left">
        <div  style="width: 20%; height: 100%; border: 1px solid red; float: left" align="center" onclick="sendClick(1)">广告1</div>
        <div  style="width: 20%; height: 100%; border: 1px solid red; float: left" align="center" onclick="sendClick(2)">广告2</div>
        <div  style="width: 20%; height: 100%; border: 1px solid red; float: left" align="center" onclick="sendClick(3)">广告3</div>
        <div  style="width: 20%; height: 100%; border: 1px solid red; float: left" align="center" onclick="sendClick(4)">广告4</div>
        <div  style="width: 20%; height: 100%; border: 1px solid red; float: left" align="center" onclick="sendClick(5)">广告5</div>
    </div>

    <a href="advertisement.html">1</a>
    <a href="advertisement2.html">2</a>

    <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript">
        for (var i = 1; i<=5; i++) {
            $.ajax({
                method: "POST",
                url: "sendBrowse",
                date: {
                    "aids": i,
                    "atype": "view"
                },
                success: function (rel) {
                    alert(rel);
                }
            });
        }

        function sendClick(id) {
            $.ajax({
                method: "POST",
                url: "sendBrowse",
                date: {
                    "aids": i,
                    "atype": "view"
                },
                success: function (rel) {
                    alert(rel);
                }
            });
        }

    </script>
</body>
</html>